Skip to content

fix: keep usage reporting off once it is turned off - #286

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/opt-out-fails-closed
Nov 19, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
fix/opt-out-fails-closed

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

A server operator reported usage reporting turning itself back on after being disabled. FishE's own switch was fail-open, and that is fixed here along with the vendored client.

  • FISHE_USAGE_REPORTING_ENABLED turned reporting off only for 0/false/no/off; an empty value, a typo or disabled left it on. Once set, it is now read through the client's allows_reporting: only true/on/yes/1 (any case) keeps reporting on, anything else turns it off. Unset still means the default, on.
  • Vendored client: trace-client-python 0.4.1 -> 0.5.0 (Make every opt-out fail closed (0.5.0) trace-client-python#45, not yet released), copied unmodified apart from the vendoring note. TRACE_USAGE_REPORTING set to anything but blank or an on-value, DO_NOT_TRACK set to anything but blank or 0/false/off/no, or an unreadable environment, now turns reporting off; enabled= is read through allows_reporting too.
  • tests/test_trace_client.py (FishE's copy of the client tests) is updated: the test that pinned TRACE_USAGE_REPORTING=disabled as not an opt-out now expects it to opt out, and tests for allows_reporting, unclear environment values, an unreadable environment and enabled="false" are added.
  • tests/config/test_config.py: the test pinning empty/anything as on is replaced by fail-closed cases.
  • The first-run notice only writes a marker file; it never changes the switch. No other re-enable path was found.
  • README and src/usageReporting.py docstring describe the fail-closed rules.

Tests

  • pytest (with the SDL dummy drivers, as test.sh): 1148 passed.

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

FISHE_USAGE_REPORTING_ENABLED was off only for 0/false/no/off: an empty
value or any other value (a typo, "disabled") left reporting on. Once set,
it is now read through the trace client's allows_reporting and fails
closed: only true/on/yes/1 keeps reporting on. Unset still means on.

Re-vendors trace-client-python 0.5.0, whose TRACE_USAGE_REPORTING /
DO_NOT_TRACK checks fail closed too; the vendored tests are updated to the
new rules. Docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson
dmccoystephenson merged commit 55f2dbf into main Nov 19, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/opt-out-fails-closed branch November 19, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant